<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增物料库存')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-materialInventory-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">入库单号：</label>
            <div class="col-sm-8">
                <input name="entryOrderId" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">物料编号：</label>
            <div class="col-sm-8">
                <input name="materialId" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">库存数量：</label>
            <div class="col-sm-8">
                <input name="entryNum" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">单价：</label>
            <div class="col-sm-8">
                <input name="unitPrice" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">产地：</label>
            <div class="col-sm-8">
                <input name="producer" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">品牌：</label>
            <div class="col-sm-8">
                <input name="brand" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">备注：</label>
            <div class="col-sm-8">
                <input name="remarks" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">税额：</label>
            <div class="col-sm-8">
                <input name="taxAmount" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">供应商：</label>
            <div class="col-sm-8">
                <select name="supplierId" class="supplier-select"></select>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: select2-js" />
<script th:inline="javascript">
    $('.supplier-select').select2({
        placeholder: '--请选择供应商--',
        ajax: {
            url: '/warehouse/supplier/selectList',
            delay: 250,
            data: function (params) {
                return {
                    supplierName: params.term
                };
            }
        }
    });
    var prefix = ctx + "warehouse/materialInventory"
    $("#form-materialInventory-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-materialInventory-add').serialize());
        }
    }
</script>
</body>
</html>